package com.xyzh05.util;

import java.util.ArrayList;
import java.util.List;

import org.displaytag.pagination.PaginatedList;
import org.displaytag.properties.SortOrderEnum;

public class PageBean implements PaginatedList {

	/** 当前页码 */
	private int pageNumber = 1;
	
	/** 每页记录数 page size */
	private int objectsPerPage = 10;
	
	/** 当前页开始记录数 */
	private int startPageNumber = 0;
	
	/** 当前页结束记录数 */
	private int endPageNumber = 0;
	
	/** 总页数 */
	private int totalPages;
	
	/** 总记录数 */
	private int fullListSize = 0;
	
	/** 当前页面的结果集 */
	private List list = new ArrayList();
	
	/** 排序的字段 */
	private String sortCriterion;
	
	/** 排序 */
	private String sortParamDirection;
	
	/** 排序的顺序，ASC、DESC */
	private SortOrderEnum sortDirection;

	private String searchId;
	/**
	 * 页面类型： simpleDetail:简单详细页面 simpleList:简单列表页面 complex:详细页面嵌套列表表单
	 */
	private String pageType;
	
	/** 详细信息Bean */
	private Object detailBean;
	
	/** 列表信息Bean */
	private List listBean;
	

	public SortOrderEnum getSortDirection() {
		if (!StringUtil.isEmpty(sortParamDirection)) {
			if (sortParamDirection.equals("asc"))
				return SortOrderEnum.ASCENDING;
			else
				return SortOrderEnum.DESCENDING;
		}
		return null;
	}

	public int getPageNumber() {
		return pageNumber;
	}

	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;
	}

	public int getObjectsPerPage() {
		return objectsPerPage;
	}

	public void setObjectsPerPage(int objectsPerPage) {
		this.objectsPerPage = objectsPerPage;
	}

	public int getStartPageNumber() {
		return startPageNumber;
	}

	public void setStartPageNumber(int startPageNumber) {
		this.startPageNumber = startPageNumber;
	}

	public int getEndPageNumber() {
		return endPageNumber;
	}

	public void setEndPageNumber(int endPageNumber) {
		this.endPageNumber = endPageNumber;
	}

	public String getSortParamDirection() {
		return sortParamDirection;
	}

	public void setSortParamDirection(String sortParamDirection) {
		this.sortParamDirection = sortParamDirection;
	}

	public int getTotalPages() {
		return totalPages;
	}

	public void setTotalPages(int totalPages) {
		this.totalPages = totalPages;
	}

	public int getFullListSize() {
		return fullListSize;
	}

	public void setFullListSize(int fullListSize) {
		this.fullListSize = fullListSize;
	}

	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}

	public String getSortCriterion() {
		return sortCriterion;
	}

	public void setSortCriterion(String sortCriterion) {
		this.sortCriterion = sortCriterion;
	}

	public void setSortDirection(SortOrderEnum sortDirection) {
		this.sortDirection = sortDirection;
	}

	public String getSearchId() {
		return searchId;
	}

	public void setSearchId(String searchId) {
		this.searchId = searchId;
	}

	public String getPageType() {
		return pageType;
	}

	public void setPageType(String pageType) {
		this.pageType = pageType;
	}

	public Object getDetailBean() {
		return detailBean;
	}

	public void setDetailBean(Object detailBean) {
		this.detailBean = detailBean;
	}

	public List getListBean() {
		return listBean;
	}

	public void setListBean(List listBean) {
		this.listBean = listBean;
	}

}
